/* Developed by Ertan Tike (ertan.tike@moreum.com) */
/* Modified version by L-P.J */

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using CoursePack;

namespace ScheduleGrid
{
    public enum AppType { Course, TimeConstraint };

    public class Appointment
    {

        protected DateTime m_StartDate;
        protected DateTime m_EndDate;
        protected AppType m_Type;

        protected bool m_Locked = false;
        protected Color color = Color.White;
        protected Color m_BorderColor = Color.Blue;
        protected Color textColor = Color.Black;
        protected string m_Title = "";
        internal int m_ConflictCount;
        

        public Appointment(DateTime _Start,DateTime _End)
        {
            this.m_StartDate = _Start;
            this.m_EndDate = _End;
        }


        protected virtual void OnStartDateChanged()
        {


        }


        protected virtual void OnEndDateChanged()
        {
        }

        [System.ComponentModel.DefaultValue(false)]
        public bool Locked
        {
            get { return m_Locked; }
            set
            {
                m_Locked = value;
                OnLockedChanged();
            }
        }

        protected virtual void OnLockedChanged()
        {
        }

        public string Title
        {
            get
            {
                return m_Title;
            }
            set
            {
                m_Title = value;
                OnTitleChanged();
            }
        }

        public Color Color
        {
            get
            {
                return color;
            }
            set
            {
                color = value;
            }
        }

        public Color TextColor
        {
            get { return textColor; }
            set { textColor = value; }
        }

        public Color BorderColor
        {
            get
            {
                return m_BorderColor;
            }
            set
            {
                m_BorderColor = value;
            }
        }

        public DateTime StartDate
        {
            get
            {
                return m_StartDate;
            }
            set
            {
                m_StartDate = value;
                OnStartDateChanged();

            }
        }

        public DateTime EndDate
        {
            get
            {
                return m_EndDate;
            }
            set
            {
                m_EndDate = value;
                OnEndDateChanged();
            }
        }


        public AppType AppointmentType
        {
            get { return this.m_Type; }
        }

        [System.ComponentModel.DefaultValue("")]

        protected virtual void OnTitleChanged()
        {
        }


    }
}
